<?php

function index_of($value, $array)
{
    foreach($array as $key=>$v)
    {
        if($v == $value)
            return $key;
    }
}

?>
